package com.hyperplan.neptune.parser.generic;

import java.util.List;

import com.hyperplan.neptune.lexer.Token;

public class EOFParser implements Parser<Object> {

	public String getPatternName() {
		return "EOF";
	}
	
	public ParserSolution<Object> parse(List<Token> tokens, int index)
			throws ParserException {
		
		if (index < tokens.size()) {
			throw new ParserException(getPatternName());
		} else {
			return new ParserSolution<Object>(null, index);
		}
	}
}
